# In Windows, you can drag and drop this configuration file to the, "scaswr.bat",
# batch file to configure Soarer's converter.  The name of this
# text file can end in *.txt or *.sc or anything else.  The *.txt extension
# might be more convenient in the Windows operating system so that you can 
# double click on the file name to edit the file in the Notepad program.

# Soarer configuration files are case-insensitive.
# You can use tab or space characters to align text.
# Text to the right of # characters are comments.

# June 13, 2020

# You can use an active female USB to male PS/2 KVM converter to attach to 
# Soarer's PS/2 to USB converter to make Soarer's converter a USB to USB 
# converter with all of Soarer's useful keyboard macro and remapping 
# capabilities. There are 3 models that I was able to find on eBay:
#
# Black Box kvusb-ps2
#
# Tripp Lite 0DT60002
#
# NTI USB-PS2-R
#
# I was able to use the Tripp Lite / Soarer's converter combination
# with the Rosewill RK-9000V2, RK-9000V2 RGB, Redragon Brahma Pro,
# Bloody B975, and Inland OMK-X USB keyboards.

# If you actually have a PC/XT keyboard, then remove 
# or comment out the following 2 lines:
ifkeyboard 0000
force set2ext

# My Rosewill RK-9000V2 keyboard can use either a PS/2 cable or a USB cable
# and returns a keyboard ID of 0000 (zero) with the PS/2 cable attached to
# Soarer's converter.  Soarer's converter incorrectly assumes the RK-9000V2
# keyboard is a PC/XT keyboard.

# set1 is the PC/XT keyboard scan code set.
# set2 is the AT keyboard scan code set.
# set2ext is the PS/2 keyboard scan code set.
# set3 is the 3179/318x/319x terminal keyboard scan code set.


ifkeyboard any
ifselect any

layerblock
  FN1 1  # FN1 is a virtual key for entering keyboard layer 1 and is not the same thing as a physical F1 function key.
  FN2 2
endblock

# Enter your default key mappings here:

remapblock
	NUM_LOCK	FN1	# The NUM_LOCK key becomes like a shift key to enter keyboard layer 1
	SCROLL_LOCK	FN2	# The SCROLL_LOCK key becomes like a shift key to enter keyboard layer 2
endblock

# The following remaps are for keyboard layer 1 which is accessed by holding down the NUM_LOCK key.
remapblock
 layer 1
	SCROLL_LOCK	SCROLL_LOCK	# NUM_LOCK SCROLL_LOCK toggles SCROLL_LOCK
endblock

# The following remaps are for keyboard layer 2 which is accessed by holding down the SCROLL_LOCK key.
remapblock
 layer 2
	NUM_LOCK	NUM_LOCK	# SCROLL_LOCK NUM_LOCK toggles NUM LOCK
endblock


# Enter your default macro definitions here:

macroblock
  # The macros with the longest number of modifiers like LCTRL LALT LSHIFT LGUI
  # should be defined first so that macros with a fewer number of modifiers
  # do not get executed first.

  # The gray number pad keys on my keyboard have no special meaning with 
  # modifiers, so any combination of modifiers like LCTRL, LALT, LSHIFT. 
  # LGUI, RCTRL, RALT, RSHIFT, RGUI can be used with the number pad keys
  # for macros:
  #
  #   NUM_LOCK 
  #   PAD_SLASH 
  #   PAD_ASTERIX
  #   PAD_MINUS
  #   PAD_PLUS
  #   PAD_ENTER

  # The modifier keys LSHIFT, RSHIFT, LCTRL, RCTRL, LALT, RALT, LGUI, RGUI
  # are declared to the right of the key that is modified.  The L prefix
  # means Left.  The R prefix means Right.
  # -ctrl means exclude both LCTRL and RCTRL
  # -alt means exclude both LALT and RALT
  # -gui means exclude both LGUI (Left Window key) and RGUI (Right Window key)

  # Pressing LEFT SHIFT with PAD_MINUS activates the Colemak keyboard layout.
  macro PAD_MINUS LSHIFT -RSHIFT -ctrl -alt -gui
    push_meta clear_meta all
    press SELECT_0  # Clear any previous keyboard layout selection
    press SELECT_1  # Activate the SELECT_1 keyboard layout, Colemak
    pop_all_meta
  endmacro

  # Pressing LEFT CTRL with PAD_MINUS activates the Dvorak keyboard layout.
  macro PAD_MINUS LCTRL -RCTRL -shift -alt -gui
    push_meta clear_meta all
    press SELECT_0  # Clear any previous keyboard layout selection
    press SELECT_2  # Activate the SELECT_2 keyboard layout, Dvorak
    pop_all_meta
  endmacro

  # Pressing LEFT ALT with PAD_MINUS resets all keyboard layout selections
  # and returns to the default keyboard layout.
  macro PAD_MINUS LALT -RALT -ctrl -shift -gui
    push_meta clear_meta all
    press SELECT_0  # Clear any previous keyboard layout selection
    pop_all_meta
  endmacro

  # LCTRL SPACE toggles the case of letters with the space
  # character replaced by an underline character, SUCH_AS_THIS.  This works 
  # with the Colemak, Dvorak, or default keyboard layouts.  This assumes
  # that the CAPS_LOCK function is not already on.  If CAPS_LOCK is on, then when
  # you toggle on SELECT_3, the letters will be in lower case and the space
  # character will be an underline, such_as_this.  You can get a regular
  # space character in this mode by pressing SHIFT SPACE.
  macro SPACE LCTRL -RCTRL -shift -alt -gui
    push_meta clear_meta all
      press CAPS_LOCK
      press SELECT_3
    pop_all_meta
  endmacro

  # While the CAPS_LOCK key is held down, the code in the, "ifselect 4", section is activated.
  # When the CAPS_LOCK key is released, then the code in the, "ifselect 4", section is deactivated.
  # Press SHIFT CAPS_LOCK to use the original CAPS_LOCK function to toggle the case of letters.
  macro CAPS_LOCK -all
    press SELECT_4
   onbreak
    press SELECT_4
  endmacro

  # Simultaneously pressing Left Shift and Right Shift will have the same
  # effect as pressing CAPS_LOCK.  This frees up the Caps Lock key to be
  # something more useful, such as the left Ctrl key (LCTRL) or as a
  # shift into keyboard layer 1. There are 2 entries here for pressing
  # either the right shift key first and then the left shift key or
  # pressing the left key first and then the right shift key.
  #
  # On the RK-9000V2 keyboard, you have to wait about a second before
  # resuming typing or the keyboard will lock up.  The LED lights for
  # CAPS_LOCK, NuM_LOCK, and SCROLL_LOCK all flash in unison when any
  # one of these keys is pressed with Soarer'r converter attached and
  # do not properly indicate the lock state of any of these keys.

# I was accidentally pressing both shift keys sometimes while typing fast.
# So, I now use NUM_LOCK CAPS_LOCK to toggle CAPS_LOCK, which is unlikely
# to happen by accident.

#  macro LSHIFT RSHIFT -ctrl -alt -gui
#    clear_meta shift
#    press CAPS_LOCK
#  endmacro

#  macro RSHIFT LSHIFT -ctrl -alt -gui
#    clear_meta shift
#    press CAPS_LOCK
#  endmacro

  # LCTRL LSHIFT I inserts an, "IF ... THEN ... ELSE ... END IF", block in Visual Basic
  macro I LCTRL LSHIFT -RCTRL -RSHIFT -alt -gui
    push_meta clear_meta all
    press i
    press f
    press SPACE
    press x
    press SPACE
    press t
    press h
    press e
    press n
    press ENTER
    press e
    press l
    press s
    press e
    press ENTER
    press e
    press n
    press d
    press SPACE
    press i
    press f
    press HOME
    press UP
    press ENTER
    press UP
    press TAB
    press DOWN
    press HOME
    press DOWN
    press ENTER
    press UP
    press TAB
    press UP
    press UP
    press UP
    press HOME
    set_meta LCTRL
    press RIGHT
    clear_meta LCTRL
    press DELETE
    pop_all_meta
  endmacro

endblock

# The previous macroblock ran out space, so start a new macroblock.
# Soarer must be doing some kind of paging of macros from EEPROM to RAM
# for the macroblock size to be so limited.

macroblock

  # LCTRL LSHIFT S inserts a, "SELECT CASE ... END SELECT", block in Visual Basic
  macro S LCTRL LSHIFT -RCTRL -RSHIFT -alt -gui
    push_meta clear_meta all
    press s
    press e
    press l
    press e
    press c
    press t
    press SPACE
    press c
    press a
    press s
    press e
    press SPACE
    press x
    press ENTER
    press e
    press n
    press d
    press SPACE
    press s
    press e
    press l
    press e
    press c
    press t
    press HOME
    press ENTER
    press UP
    press TAB
    press c
    press a
    press s
    press e
    press SPACE
    pop_all_meta
  endmacro

  # LCTRL LSHIFT W inserts a, "WHILE ... WEND", block in Visual Basic
  macro W LCTRL LSHIFT -RCTRL -RSHIFT -alt -gui
    push_meta clear_meta all
    press w
    press h
    press i
    press l
    press e
    press SPACE
    press x
    press ENTER
    press w
    press e
    press n
    press d
    press HOME
    press ENTER
    press UP
    press TAB
    press UP
    press END
    press BACKSPACE
    pop_all_meta
  endmacro

  # LCTRL LSHIFT D inserts a, "DO ... LOOP UNTIL", block in Visual Basic
  macro D LCTRL LSHIFT -RCTRL -RSHIFT -alt -gui
    push_meta clear_meta all
    press d
    press o
    press ENTER
    press l
    press o
    press o
    press p
    press SPACE
    press u
    press n
    press t
    press i
    press l
    press HOME
    press ENTER
    press UP
    press TAB
    press DOWN
    press END
    press SPACE
    pop_all_meta
  endmacro

  # LCTRL LSHIFT F inserts a, "FOR ... NEXT", block in Visual Basic
  macro F LCTRL LSHIFT -RCTRL -RSHIFT -alt -gui
    push_meta clear_meta all
    press f
    press o
    press r
    press SPACE
    press i
    press EQUAL	# =
    press 1
    press SPACE
    press t
    press o
    press SPACE
    press n
    press ENTER
    press n
    press e
    press x
    press t
    press HOME
    press ENTER
    press UP
    press TAB
    press UP
    press HOME
    set_meta LCTRL
    press RIGHT
    clear_meta LCTRL
    pop_all_meta
  endmacro
endblock


# The contents of the sample, "colemak.sc", and, "dvorak.sc", files are
# included here for easy adjustment.

ifselect 1

# Colemak keyboard layout.
# Holding down the LEFT SHIFT key and then pressing the PAD_MINUS key
# activates the Select 1 state and the Colemak keyboard layout
# which stays active until you switch to another keyboard layout.

remapblock
	D S
	E F
	F T
	G D
	I U
	J N
	K E
	L I
	N K
	O Y
	P SEMICOLON
	R P
	S R
	T G
	U L
	Y J
	SEMICOLON O
endblock



ifselect 2

# Dvorak keyboard layout - contributed by Morning Song.
# Holding down the LEFT CTRL key and then pressing the PAD_MINUS key
# activates the Select 2 state and the Dvorak keyboard layout
# which stays active until you switch to another keyboard layout.

remapblock
	MINUS		LEFT_BRACE
	EQUAL		RIGHT_BRACE
	Q		QUOTE
	W		COMMA
	E		PERIOD
	R		P
	T		Y
	Y		F
	U		G
	I		C
	O		R
	P		L
	LEFT_BRACE	SLASH
	RIGHT_BRACE	EQUAL
#	A		A
	S		O
	D		E
	F		U
	G		I
	H		D
	J		H
	K		T
	L		N
	SEMICOLON	S
	QUOTE		MINUS	
	Z		SEMICOLON
	X		Q
	C		J
	V		K
	B		X
	N		B
#	M		M
	COMMA		W
	PERIOD		V
	SLASH		Z		
endblock



ifselect 3

# You can have macros in SELECT configurations
macroblock
  # Pressing SPACE produces an underline character in this configuration.
  # You can press SHIFT SPACE to get a regular space character.
  macro SPACE -all
    set_meta LSHIFT
    press MINUS
    clear_meta LSHIFT
  endmacro

endblock



ifselect 4

# The following remaps and macros are accessed by holding down the CAPS_LOCK key.

remapblock
	C		PAGE_DOWN	# CAPS_LOCK C is like the WordStar text editor command to page down
	R		PAGE_UP		# CAPS_LOCK R is like the WordStar text editor command to page up

	G		DELETE		# CAPS_LOCK G is like the WordStar command to delete a character
	H		BACKSPACE	# CAPS_LOCK H is like the WordStar command to backspace

	NUM_LOCK	NUM_LOCK	# CAPS_LOCK NUM_LOCK toggles NUM LOCK
	SCROLL_LOCK	SCROLL_LOCK	# CAPS_LOCK SCROLL_LOCK toggles SCROLL_LOCK
endblock


macroblock

  # Rather than remapping the following letters to arrow keys, a macro has to be made
  # for each letter key so that the arrow keys can be used for something else.

  # CAPS_LOCK E is UP arrow
  macro E
    make UP     # Allow the key to repeat while the key is held down
   onbreak
    break UP    # Stop repeating when the key is lifted
  endmacro

  # CAPS_LOCK X is DOWN arrow
  macro X
    make DOWN
   onbreak
    break DOWN
  endmacro

  # CAPS_LOCK S is LEFT arrow
  macro S
    make LEFT
   onbreak
    break LEFT
  endmacro

  # CAPS_LOCK D is RIGHT arrow
  macro D
    make RIGHT
   onbreak
    break RIGHT
  endmacro

  # CAPS_LOCK UP arrow maximizes the current window
  macro UP -all
    set_meta LGUI
    press UP
    clear_meta LGUI
  endmacro

  # CAPS_LOCK DOWN arrow un-maximizes the current window
  macro DOWN -all
    set_meta LGUI
    press DOWN
    clear_meta LGUI
  endmacro

  # CAPS_LOCK LEFT arrow moves the current window to the another screen in a multiple monitor setup
  macro LEFT -all
    set_meta LSHIFT LGUI
    press LEFT
    clear_meta LSHIFT LGUI
  endmacro

  # CAPS_LOCK RIGHT arrow moves the current window to the another screen in a multiple monitor setup
  macro RIGHT -all
    set_meta LSHIFT LGUI
    press RIGHT
    clear_meta LSHIFT LGUI
  endmacro

  # CAPS_LOCK F presses LCTRL RIGHT arrow to move forward one word
  # -all is equivalent to excluding all left and right side modifier keys:  -shift -ctrl -alt -gui
  # The, "norestoremeta", clause seems to prevent the restoration of the pressed state of the meta keys 
  # (CTRL, ALT, SHIFT, Windows keys) when the macro completes.  Without the, "norestoremeta", clause,
  # the Left Control key will still be pressed when the following macro completes even though the
  # Left Control key is not physically still pressed.  The meaning of, "make", and, "break", is clear
  # when you think of a key as an electrical switch that makes contact or breaks contact to complete
  # an electrical circuit.
  macro F -all
    set_meta LCTRL
    make RIGHT     # Allow the macro to repeat until the key is released
   onbreak norestoremeta
    clear_meta LCTRL
    break RIGHT
  endmacro

  # CAPS_LOCK A presses LCTRL LEFT arrow to move back one word
  macro A -all
    set_meta LCTRL
    make LEFT     # Allow the macro to repeat until the key is released
   onbreak norestoremeta
    clear_meta LCTRL
    break LEFT
  endmacro

  # CAPS_LOCK LSHIFT QUOTE macro to comment a line in Visual Basic.  The cursor has to be at the start of the line.
  macro QUOTE LSHIFT -rshift -ctrl -alt -gui
    push_meta clear_meta all
    press QUOTE
    press LEFT
    press DOWN
    pop_all_meta
  endmacro

  # CAPS_LOCK QUOTE creates 2 double quotes and moves the cursor in between the 2 double quotes.
  macro QUOTE -all
    set_meta LSHIFT
    press QUOTE
    press QUOTE
    clear_meta LSHIFT
    press LEFT
  endmacro

  # CAPS_LOCK Y select and cut the current line
  macro Y -all
    press END
    press HOME
    press HOME
    set_meta LSHIFT
    press END
    press RIGHT
    clear_meta LSHIFT
    set_meta LCTRL
    press X
    clear_meta LCTRL
  endmacro

  # CAPS_LOCK U paste
  macro U -all
    set_meta LCTRL
    press V
    clear_meta LCTRL
  endmacro

  # CAPS_LOCK ( inserts ( ) because I never use an opening parenthesis without a closing parenthesis
  macro 9 -all
    set_meta LSHIFT
    press 9
    press 0
    clear_meta LSHIFT
    press LEFT
  endmacro

  # CAPS_LOCK [ inserts [ ] because I never use a left brace without a right brace
  macro LEFT_BRACE -all
    press LEFT_BRACE
    press RIGHT_BRACE
    press LEFT
  endmacro

  # CAPS_LOCK LSHIFT [ inserts { } because I never use a left curly brace without a right curly brace
  # in the C programming language or C++ programming language.
  macro LEFT_BRACE LSHIFT -rshift -ctrl -alt -gui
    push_meta clear_meta all
      set_meta LSHIFT
      press LEFT_BRACE
      press RIGHT_BRACE
      clear_meta LSHIFT
      press LEFT
      press ENTER
      press ENTER
      press UP
      press SPACE
      press SPACE
      press SPACE
      press SPACE
    pop_all_meta
  endmacro

endblock

macroblock

  # CAPS_LOCK I inserts an, "IF ... THEN ... END IF", block in Visual Basic
  macro I -all
    press i
    press f
    press SPACE
    press x
    press SPACE
    press t
    press h
    press e
    press n
    press ENTER
    press e
    press n
    press d
    press SPACE
    press i
    press f
    press HOME
    press ENTER
    press UP
    press TAB
    press UP
    press HOME
    set_meta LCTRL
    press RIGHT
    clear_meta LCTRL
    press DELETE
  endmacro

  # CAPS_LOCK LSHIFT I outputs a message, "It was nice doing business with you."
  # The CAPS_LOCK key has to be pressed first, then the left shift key, and then the letter I.
  # Otherwise, the CAPS_LOCK function will toggle and the macro will not execute.
  macro I LSHIFT -RSHIFT -ctrl -alt -gui
    push_meta clear_meta all
    set_meta LSHIFT
    press i
    clear_meta LSHIFT
    press t
    press SPACE
    press w
    press a
    press s
    press SPACE
    press n
    press i
    press c
    press e
    press SPACE
    press d
    press o
    press i
    press n
    press g
    press SPACE
    press b
    press u
    press s
    press i
    press n
    press e
    press s
    press s
    press SPACE
    press w
    press i
    press t
    press h
    press SPACE
    press y
    press o
    press u
    press PERIOD
    pop_all_meta
  endmacro

##
endblock


#
# Modified HID Code set Reference
#
#
# If you run the:
#
#   hid_listen.exe
#
# program and press a key, look for a + sign followed by a
# hexadecimal number in the output to identify the key you pressed.
#
# The codes on the left side of the following list are what you use
# to remap keys.  The text on the right side are Soarer's comments.

# UNASSIGNED		+00	No Event
# OVERRUN_ERROR		+01	Overrun Error
# POST_FAIL		+02	POST Fail
# ERROR_UNDEFINED	+03	ErrorUndefined
# A			+04	a A
# B			+05	b B
# C			+06	c C
# D			+07	d D
# E			+08	e E
# F			+09	f F
# G			+0A	g G
# H			+0B	h H
# I			+0C	i I
# J			+0D	j J
# K			+0E	k K
# L			+0F	l L
# M			+10	m M
# N			+11	n N
# O			+12	o O
# P			+13	p P
# Q			+14	q Q
# R			+15	r R
# S			+16	s S
# T			+17	t T
# U			+18	u U
# V			+19	v V
# W			+1A	w W
# X			+1B	x X
# Y			+1C	y Y
# Z			+1D	z Z
# 1			+1E	1 !
# 2			+1F	2 @
# 3			+20	3 #
# 4			+21	4 $
# 5			+22	5 %
# 6			+23	6 ^
# 7			+24	7 &
# 8			+25	8 *
# 9			+26	9 (
# 0			+27	0 )
# ENTER			+28	Return
# ESC			+29	Escape
# BACKSPACE		+2A	Backspace
# TAB			+2B	Tab
# SPACE			+2C	Space
# MINUS			+2D	- _
# EQUAL			+2E	= +
# LEFT_BRACE		+2F	[ {
# RIGHT_BRACE		+30	] }
# BACKSLASH		+31	\ |
# EUROPE_1		+32	Europe 1 (use BACKSLASH instead)
# SEMICOLON		+33	; :
# QUOTE			+34	' "
# BACK_QUOTE		+35	` ~
# COMMA			+36	, <
# PERIOD		+37	. >
# SLASH			+38	/ ?
# CAPS_LOCK		+39	Caps Lock
# F1			+3A	F1
# F2			+3B	F2
# F3			+3C	F3
# F4			+3D	F4
# F5			+3E	F5
# F6			+3F	F6
# F7			+40	F7
# F8			+41	F8
# F9			+42	F9
# F10			+43	F10
# F11			+44	F11
# F12			+45	F12
# PRINTSCREEN		+46	Print Screen
# SCROLL_LOCK		+47	Scroll Lock
# PAUSE			+48	Pause
# INSERT		+49	Insert
# HOME			+4A	Home
# PAGE_UP		+4B	Page Up
# DELETE		+4C	Delete
# END			+4D	End
# PAGE_DOWN		+4E	Page Down
# RIGHT			+4F	Right Arrow
# LEFT			+50	Left Arrow
# DOWN			+51	Down Arrow
# UP			+52	Up Arrow
# NUM_LOCK		+53	Num Lock
# PAD_SLASH		+54	Keypad /
# PAD_ASTERIX		+55	Keypad *
# PAD_MINUS		+56	Keypad -
# PAD_PLUS		+57	Keypad +
# PAD_ENTER		+58	Keypad Enter
# PAD_1			+59	Keypad 1 End
# PAD_2			+5A	Keypad 2 Down
# PAD_3			+5B	Keypad 3 PageDn
# PAD_4			+5C	Keypad 4 Left
# PAD_5			+5D	Keypad 5
# PAD_6			+5E	Keypad 6 Right
# PAD_7			+5F	Keypad 7 Home
# PAD_8			+60	Keypad 8 Up
# PAD_9			+61	Keypad 9 PageUp
# PAD_0			+62	Keypad 0 Insert
# PAD_PERIOD		+63	Keypad . Delete
# EUROPE_2		+64	Europe 2
# APP			+65	App (Windows Menu)
# POWER			+66	Keyboard Power
# PAD_EQUALS		+67	Keypad =
# F13			+68	F13
# F14			+69	F14
# F15			+6A	F15
# F16			+6B	F16
# F17			+6C	F17
# F18			+6D	F18
# F19			+6E	F19
# F20			+6F	F20
# F21			+70	F21
# F22			+71	F22
# F23			+72	F23
# F24			+73	F24
# EXECUTE		+74	Keyboard Execute
# HELP			+75	Keyboard Help
# MENU			+76	Keyboard Menu
# SELECT		+77	Keyboard Select
# STOP			+78	Keyboard Stop
# AGAIN			+79	Keyboard Again
# UNDO			+7A	Keyboard Undo
# CUT			+7B	Keyboard Cut
# COPY			+7C	Keyboard Copy
# PASTE			+7D	Keyboard Paste
# FIND			+7E	Keyboard Find
# MUTE			+7F	Keyboard Mute
# VOLUME_UP		+80	Keyboard Volume Up
# VOLUME_DOWN		+81	Keyboard Volume Dn
# LOCKING_CAPS_LOCK	+82	Keyboard Locking Caps Lock
# LOCKING_NUM_LOCK	+83	Keyboard Locking Num Lock
# LOCKING_SCROLL_LOCK	+84	Keyboard Locking Scroll Lock
# PAD_COMMA		+85	Keypad comma (Brazilian Keypad .)
# EQUAL_SIGN		+86	Keyboard Equal Sign
# INTERNATIONAL_1	+87	Keyboard Int'l 1 (Ro)
# INTERNATIONAL_2	+88	Keyboard Intl'2 (Katakana/Hiragana)
# INTERNATIONAL_3	+89	Keyboard Int'l 2 (Yen)
# INTERNATIONAL_4	+8A	Keyboard Int'l 4 (Henkan)
# INTERNATIONAL_5	+8B	Keyboard Int'l 5 (Muhenkan)
# INTERNATIONAL_6	+8C	Keyboard Int'l 6 (PC9800 Keypad comma)
# INTERNATIONAL_7	+8D	Keyboard Int'l 7
# INTERNATIONAL_8	+8E	Keyboard Int'l 8
# INTERNATIONAL_9	+8F	Keyboard Int'l 9
# LANG_1		+90	Keyboard Lang 1 (Hanguel/English)
# LANG_2		+91	Keyboard Lang 2 (Hanja)
# LANG_3		+92	Keyboard Lang 3 (Katakana)
# LANG_4		+93	Keyboard Lang 4 (Hiragana)
# LANG_5		+94	Keyboard Lang 5 (Zenkaku/Hankaku)
# LANG_6		+95	Keyboard Lang 6
# LANG_7		+96	Keyboard Lang 7
# LANG_8		+97	Keyboard Lang 8
# LANG_9		+98	Keyboard Lang 9
# ALTERNATE_ERASE	+99	Keyboard Alternate Erase
# SYSREQ_ATTN		+9A	Keyboard SysReq/Attention
# CANCEL		+9B	Keyboard Cancel
# CLEAR			+9C	Keyboard Clear (use DELETE instead)
# PRIOR			+9D	Keyboard Prior
# RETURN		+9E	Keyboard Return
# SEPARATOR		+9F	Keyboard Separator
# OUT			+A0	Keyboard Out
# OPER			+A1	Keyboard Oper
# CLEAR_AGAIN		+A2	Keyboard Clear/Again
# CRSEL_PROPS		+A3	Keyboard CrSel/Props
# EXSEL			+A4	Keyboard ExSel
# SYSTEM_POWER		+A8	System Power
# SYSTEM_SLEEP		+A9	System Sleep
# SYSTEM_WAKE		+AA	System Wake
# AUX1			+AB	Auxiliary key 1
# AUX2			+AC	Auxiliary key 2
# AUX3			+AD	Auxiliary key 3
# AUX4			+AE	Auxiliary key 4
# AUX5			+AF	Auxiliary key 5
# FAKE_01		+B0	extra
# EXTRA_LALT		+B1	AT-F extra pad lhs of space
# EXTRA_PAD_PLUS	+B2	Term extra pad bottom of keypad +
# EXTRA_RALT		+B3	AT-F extra pad rhs of space
# EXTRA_EUROPE_2	+B4	AT-F extra pad lhs of enter
# EXTRA_BACKSLASH	+B5	AT-F extra pad top of enter
# EXTRA_INSERT		+B6	AT-F extra pad lhs of Insert
# EXTRA_F1		+B7	122-key Terminal lhs F1
# EXTRA_F2		+B8	122-key Terminal lhs F2
# EXTRA_F3		+B9	122-key Terminal lhs F3
# EXTRA_F4		+BA	122-key Terminal lhs F4
# EXTRA_F5		+BB	122-key Terminal lhs F5
# EXTRA_F6		+BC	122-key Terminal lhs F6
# EXTRA_F7		+BD	122-key Terminal lhs F7
# EXTRA_F8		+BE	122-key Terminal lhs F8
# EXTRA_F9		+BF	122-key Terminal lhs F9
# EXTRA_F10		+C0	122-key Terminal lhs F10
# FAKE_18		+C1	extra
# EXTRA_SYSRQ		+C2	Sys Req (AT 84-key)
# FN1			+D0	Function layer key 1
# FN2			+D1	Function layer key 2
# FN3			+D2	Function layer key 3
# FN4			+D3	Function layer key 4
# FN5			+D4	Function layer key 5
# FN6			+D5	Function layer key 6
# FN7			+D6	Function layer key 7
# FN8			+D7	Function layer key 8
# SELECT_0		+D8	Select reset
# SELECT_1		+D9	Select 1 toggle
# SELECT_2		+DA	Select 2 toggle
# SELECT_3		+DB	Select 3 toggle
# SELECT_4		+DC	Select 4 toggle
# SELECT_5		+DD	Select 5 toggle
# SELECT_6		+DE	Select 6 toggle
# SELECT_7		+DF	Select 7 toggle
# LCTRL			+E0	Left Control
# LSHIFT		+E1	Left Shift
# LALT			+E2	Left Alt
# LGUI			+E3	Left GUI (Left Windows)
# RCTRL			+E4	Right Control
# RSHIFT		+E5	Right Shift
# RALT			+E6	Right Alt
# RGUI			+E7	Right GUI (Right Windows)
# MEDIA_NEXT_TRACK	+E8	Scan Next Track
# MEDIA_PREV_TRACK	+E9	Scan Previous Track
# MEDIA_STOP		+EA	Stop
# MEDIA_PLAY_PAUSE	+EB	Play/ Pause
# MEDIA_MUTE		+EC	Mute
# MEDIA_BASS_BOOST	+ED	Bass Boost
# MEDIA_LOUDNESS	+EE	Loudness
# MEDIA_VOLUME_UP	+EF	Volume Up
# MEDIA_VOLUME_DOWN	+F0	Volume Down
# MEDIA_BASS_UP		+F1	Bass Up
# MEDIA_BASS_DOWN	+F2	Bass Down
# MEDIA_TREBLE_UP	+F3	Treble Up
# MEDIA_TREBLE_DOWN	+F4	Treble Down
# MEDIA_MEDIA_SELECT	+F5	Media Select
# MEDIA_MAIL		+F6	Mail
# MEDIA_CALCULATOR	+F7	Calculator
# MEDIA_MY_COMPUTER	+F8	My Computer
# MEDIA_WWW_SEARCH	+F9	WWW Search
# MEDIA_WWW_HOME	+FA	WWW Home
# MEDIA_WWW_BACK	+FB	WWW Back
# MEDIA_WWW_FORWARD	+FC	WWW Forward
# MEDIA_WWW_STOP	+FD	WWW Stop
# MEDIA_WWW_REFRESH	+FE	WWW Refresh
# MEDIA_WWW_FAVORITES	+FF	WWW Favorites

# Deprecated Code Names

# FAKE_01		+B0	extra
# FAKE_02		+B1	AT-F extra pad lhs of space
# FAKE_03		+B2	Term extra pad bottom of keypad +
# FAKE_04		+B3	AT-F extra pad rhs of space
# FAKE_05		+B4	AT-F extra pad lhs of enter
# FAKE_06		+B5	AT-F extra pad top of enter
# FAKE_07		+B6	AT-F extra pad lhs of Insert
# FAKE_08		+B7	Term F1
# FAKE_09		+B8	Term F2
# FAKE_10		+B9	Term F3
# FAKE_11		+BA	Term F4
# FAKE_12		+BB	Term F5
# FAKE_13		+BC	Term F6
# FAKE_14		+BD	Term F7
# FAKE_15		+BE	Term F8
# FAKE_16		+BF	Term F9
# FAKE_17		+C0	Term F10
# FAKE_18		+C1	extra
# FAKE_19		+C2	Sys Req (AT 84-key)

# Modifiers

# LCTRL		Left Control
# LSHIFT	Left Shift
# LALT		Left Alt
# LGUI		Left GUI (Left Windows)
# RCTRL		Right Control
# RSHIFT	Right Shift
# RALT		Right Alt
# RGUI		Right GUI (Right Windows)
# CTRL		Either/Both Control (shorthand for LCTRL RCTRL)
# SHIFT		Either/Both Shift (shorthand for LSHIFT RSHIFT)
# ALT		Either/Both Alt (shorthand for LALT RALT)
# GUI		Either/Both GUI (shorthand for LGUI RGUI)
# ALL		Any/All (shorthand for CTRL SHIFT ALT GUI)
